package com.AAA.controller.mht;

import com.AAA.entity.LayData;
import com.AAA.entity.MyPage;
import com.AAA.entity.mht.TMhtPlane;
import com.AAA.service.mht.ITmhtPlaneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

@RestController
@RequestMapping("tmhtplane")
public class TmhtPlaneController {

    @Autowired
    private ITmhtPlaneService service;

    @RequestMapping("queryall")
    public LayData queryAll(MyPage myPage, TMhtPlane tMhtPlane){
        return new LayData(service.queryall(myPage,tMhtPlane));
    }
    @PostMapping("addplane")
    public LayData add(TMhtPlane tMhtPlane){

        return new LayData( service.add(tMhtPlane));
    }
    @PostMapping("updatas")
    public LayData updata(TMhtPlane tMhtPlane){
        return  new LayData(service.updatastatus(tMhtPlane));
    }

    @PostMapping("checkname")
    public LayData checkname(String planename){

        return new LayData( service.checkname(planename));
    }
@RequestMapping("checkcode")
    public LayData checkcode (String code){
        return new LayData(service.checkcode(code));
    }
    @RequestMapping("getByCode")
    public LayData getByCode(String code){
        return new LayData(service.getByCode(code));
    }
    @PostMapping("del")
    public LayData delece(Integer id){
          return new LayData(service.delete(id)) ;
    }
}


